﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<BlogPostListPaginationViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
    <title><%= Model.Localize("PostsPageTitle")%></title>
    <%= Html.GetCssFile(Url.GetModuleCssPath("MvcEngine.Blog.BackOffice.css")) %>
</asp:Content>


<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">

    <div class="page-title" id="post-header">
         <h1><%= Model.Localize("PostsPageHeader")%></h1>
    </div>
    
    <div class="page-menu">
        <%= Html.UrlActionLink(Model.Localize("BackLink"), Url.Blogs())%> |
        <%= Html.UrlActionLink(Model.Localize("NewPostLink"), Url.NewPost()) %> |
        <%= Html.UrlActionLink(Model.Localize("SettingsLink"), Url.BlogSettings()) %> |
        <%= Html.UrlActionLink(Model.Localize("ImportPageLink"), Url.BlogImport())%> |
        <%= Html.UrlActionLink(Model.Localize("CategoriesPageLink"), Url.BlogCategories())%> |
        <%= Html.UrlActionLink(Model.Localize("TagsPageLink"), Url.BlogTags())%> |
        <%= Html.UrlActionLink(Model.Localize("CommentsPageLink"), Url.Comments())%>
    </div>
    
   <div>
        <%= Html.Grid(Model.Posts).Columns(column =>
        {
            column.For(x => Html.GetPartial("RowDetails", x)).Header("Title").DoNotEncode();
            column.For(x => Html.GetPartial("CategoriesColumn", x)).Header("Categories").DoNotEncode();
            column.For(x => Html.GetPartial("PublishedColumn", x)).Header("Date").DoNotEncode();
        }).Attributes(cellSpacing => "0", cellPadding => "0", border => "0")
        .Footers(footer => 
          {
              footer.For("Pages: " + Model.TotalPages.GetPaging(p => Html.UrlActionLink(p.ToString(), Url.PostPage(p)) + "&nbsp;")).DoNotEncode().Attributes(colspan => "2");
              footer.For(string.Format("Total items: {0}", Model.TotalItems));
          })%>
           
   </div>
 
</asp:Content>
